package main

import (
	"fmt"
	"net/http"
)

func httpServer1() {
	http.HandleFunc("/", func(w http.ResponseWriter, r *http.Request) {
		fmt.Fprintf(w, "用户名: %s", r.URL.Path[1:])
	})
	http.ListenAndServe(":8080", nil)
	//启动后,浏览器输入 http://localhost:8080/zhangsan
}
func main() {
	httpServer1()
}
